home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gekikoh Dennoh Club 2
/
Gekikoh Dennoh Club Vol. 2 (Japan).7z
/
Gekikoh Dennoh Club Vol. 2 (Japan) (Track 01).bin
/
kowin
/
font
/
tcwin24s.lzh
/
tc_ok.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-01-28
|
2KB
|
114 lines
/*
Ko-Windowライブラリ 1990 by 小笠原博之 SPS0783 COR.
*/
#include <stdio.h>
#include <wlib.h>
#include <parts.h>
static char *str;
static char *str2;
static int OKexec();
static int INPexec();
OK( msg1, msg2 )
char *msg1;
char *msg2;
{
EventInfo Info;
WindowID wp;
ClipClass yes,
no;
str= msg1;
str2= msg2;
wp = WindowSimpleOpen( 234, 200, 300, 80, NULL, OKexec );
WindowRedraw( wp );
ClipSet( &yes, 60-30, 50-4, 60, 24 );
ClipSet( &no, 240-30, 50-4, 60, 24 );
for(;;){
WindowGetEventInfo( &Info );
if( Info.LeftStat && WindowGetChild( WindowRootID, &Info ) == wp ){
if( ClipInner( &yes, Info.x, Info.y ) ){
WindowClose( wp );
return TRUE;
}else if ( ClipInner( &no, Info.x, Info.y ) ){
WindowClose( wp );
return FALSE;
}
}
}
}
static
OKexec( wp, info )
WindowID wp;
EventInfo *info;
{
DrawBuf buf[10];
switch( info->option ){
case EventRedraw:
DrawSetClear( buf, 1 );
DrawSetSymbol( buf+1, 30, 4, str, AttrDefault, 12 );
DrawSetSymbol( buf+2, 30, 6+12, str2, AttrDefault, 12 );
DrawSetSymbol( buf+3, 60-24, 50, "YES", AttrDefault, 16 );
DrawSetSymbol( buf+4, 240-16, 50, "NO", AttrDefault, 16 );
DrawSetLine( buf+5, 60-30, 50-4, 60+30, 50+20, ShadowDown, OptionShadow );
DrawSetLine( buf+6, 240-30, 50-4, 240+30, 50+20, ShadowDown, OptionShadow );
WindowDraw( wp, buf, 7 );
break;
}
return TRUE;
}
static InputClass input;
lineinput( ibuf )
char *ibuf;
{
EventInfo Info;
WindowID wp;
int i;
InputSet( &input, 4, 4, ibuf, 37, 9, 16 );
wp = WindowSimpleOpen( 234, 200, 300, 22, NULL, INPexec );
WindowRedraw( wp );
*ibuf= '\0';
for(;;){
if( WindowGetEventInfo( &Info ) ){
DrawBuf buf[10];
if( Info.KeyCode ){
if( Info.KeyCode == 13 ){
WindowClose( wp );
return;
}
WindowDraw( wp, buf, InputKey(buf, &input, Info.KeyCode, Info.ShiftStat) );
}
}
}
}
static
INPexec( wp, info )
WindowID wp;
EventInfo *info;
{
DrawBuf buf[12];
switch( info->option ){
case EventRedraw:
DrawSetClear( buf, 1 );
DrawSetLine( buf+1, 2, 2, 298, 20, ShadowDown, OptionShadow );
WindowDraw( wp, buf, 2+InputSetDraw( buf+2, &input ) );
}
return TRUE;
}